Skip to content

Split ucode setup into per-section commands + apply diff + wizard UX - #341

Merged
lilly-luo merged 7 commits into
mainfrom
split-ucode-setup
Aug 18, 2026
Merged

Split ucode setup into per-section commands + apply diff + wizard UX#341
lilly-luo merged 7 commits into
mainfrom
split-ucode-setup

Conversation

@rohita5l

Copy link
Copy Markdown
Collaborator

What

Breaks the monolithic ucode setup into focused commands and polishes the interactive wizard.

Command surface

ucode setup now configures agents and models only, then prints a checklist of what's left. Each other section is its own command:

Command Does
ucode setup Agents, per-agent models/provider service, settings scope
ucode setup mcp Managed MCP servers
ucode setup skills [--location a.b,c.d] Managed skills
ucode setup budget-policy Spend-based routing policy
ucode setup help Walkthrough of the whole sequence, marking what's configured
  • A re-run of ucode setup carries the other sections forward instead of clearing them (a re-run after ucode revert/fresh machine falls back to the workspace's published config). A carried budget policy that no longer fits the enabled agents is dropped with a warning rather than blocking the save.
  • The section commands require ucode setup to have run first; they validate structurally (no model-inventory re-check, since they don't touch models).

ucode apply diff

Before the confirmation prompt, apply shows a human-readable ADD / DELETE / CHANGE diff against the published config (normalized the same way it will be sent, so no phantom changes), and does nothing when the two already match.

Wizard UX

  • Step banners (step 2 of 3 · Models & settings), per-agent progress counters, and a uniform ✔ <agent> configured — <model> · <scope> line per agent.
  • "Selected so far" recap before the default-agent pick; Claude family-slot recap before its overall-default pick.
  • Boxed "What is a budget policy?" explanation (shown only once a usable budget exists); budgets are checked first, with a boxed warning and no blurb when none can attach.
  • Budget tiers shown as spend ranges (under 50%, 50–90%, 90%+) anchored by the manifest default; a duplicate agent/model re-asks only the agent/model, keeping the percentage.
  • Codex model lists sort newest-first (matching Gemini); Gemini dropped from the setup picker (still launchable via ucode gemini).

Testing

  • uv run pytest (non-e2e): 1856 pass. The one failure, test_mcp.py::TestConfigureMcpCommand::test_registers_discovered_external_server, is pre-existing on main (verified on a clean checkout) and unrelated to this change.
  • uv run ruff check . clean.

This pull request and its description were written by Isaac.

…zard UX

Split the monolithic `ucode setup` into `ucode setup` (agents + models) plus
`ucode setup mcp` / `skills` / `budget-policy` / `help`, each editing one section
of the same managed config. `ucode setup` now carries the other sections forward
on a re-run instead of clearing them.

`ucode apply` shows a human-readable ADD/DELETE/CHANGE diff against the published
config before confirming, and does nothing when they already match.

Wizard UX: step banners, per-agent progress and a uniform per-agent confirmation,
a "Selected so far" recap, a Claude family-slot recap, a boxed "What is a budget
policy?" explanation, spend-range budget tiers with an anchored default, and a
boxed warning when no attachable budget exists. Codex model lists now sort
newest-first. Gemini is dropped from the setup picker (still launchable).

Co-authored-by: Isaac
Make clear the MCP / skills / budget-policy commands aren't required to publish,
so a config with none configured doesn't read as unfinished.

Co-authored-by: Isaac

@AarushiShah-db AarushiShah-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setup_mcp_err.mov

See repro of one error found during ucode setup mcp - when I try to add new mcp's it doesn't seem to take affect?

Summary from claude on the error
"setup_mcp_command gates the manifest update on whether the local-state MCP
snapshot changed around the picker (before == after) instead of on whether it
differs from what the manifest already holds. So if an admin already has the
desired MCP server registered locally and just confirms it in the picker
without toggling anything, before == after, the command reports "No changes,"
and the server never gets written to manifest["mcp_servers"] — publishing a
managed config with no MCP servers."

Comment thread src/ucode/cli.py Outdated
Comment thread src/ucode/managed_wizard.py Outdated
Comment thread src/ucode/managed_wizard.py Outdated
Comment thread src/ucode/managed_wizard.py
Comment thread README.md
@lilly-luo

lilly-luo commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

to test:

  • ucode setup - single pass ✅
  • ucode setup - change default coding agent, does ucode apply show the diffs correctly? does it work when i apply? ✅
Screenshot 2026-08-17 at 9 57 37 PM
  • ucode setup mcp - then change the mcp, does it work ok ✅

Comment thread src/ucode/cli.py Outdated
Comment thread src/ucode/cli.py Outdated
rohita5l and others added 2 commits August 18, 2026 08:57
Address PR review feedback:
- Rename `ucode setup budget-policy` -> `ucode setup spend-tiers` and the
  user-facing labels to "Tiered Spend Policy" (Ali/lilly feedback); the
  `budget_policy` manifest key is unchanged.
- Rename `ucode setup mcp` -> `ucode setup mcps` for plural consistency with
  `skills`.
- Clarify the tier-percentage prompt with an "Ex: 50%" hint so admins don't
  enter 0.5 to mean 50%.
- Offer to publish at the end of each setup section (`_offer_apply`) so an
  admin can apply incrementally instead of re-running the whole flow.
- Fix `setup mcps` dropping servers that were already registered via
  `ucode configure mcp`: the no-op check compared post-picker local state to
  pre-picker local state, so carried-forward servers looked unchanged and were
  never written to the manifest. Now also sync when local state holds servers
  the manifest is missing, guarded so an Esc on empty state can't wipe a
  published section.

Co-authored-by: Isaac
@lilly-luo

lilly-luo commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

to test:

  • ucode setup has "apply y/n" at end + works
  • ucode setup mcps (plural) has "apply y/n" at end + works
  • ucode setup --help has spend-tiers instead of budget policy
  • ucode setup spend-tiers works and has the updated verbiage

@lilly-luo
lilly-luo enabled auto-merge (squash) August 18, 2026 17:55
@lilly-luo

Copy link
Copy Markdown
Collaborator

/merge

@lilly-luo
lilly-luo merged commit b60c495 into main Aug 18, 2026
2 checks passed
@lilly-luo
lilly-luo deleted the split-ucode-setup branch August 18, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants